package demo2;

/**
 * Version: 1.1
 * Author: TangJun
 * Date: 2024-07-18
 */


public class DeepCopy {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person a = new Person();
        a.col.color = "blue";
        a.age = 18;
        Person b = (Person)a.clone();
        a.col.color = "red";
        System.out.println(a);
        System.out.println(b);
    }
}
